// pages/setgrzl/setgrzl.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    hidFeet: true,
    nickName: null,
    touxiangurl: '../../image/qxtx/xuni.png',
    introduction: null,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this;
    that.setData({
      nickName: getApp().globalData.userInfo.nickName,
      touxiangurl: getApp().globalData.userInfo.avatarUrl,
    })
    if (getApp().globalData.accountINFO.introduction == null){
      that.setData({
        introduction: "这个人好懒什么都没留下",
      })
    }else{
      that.setData({
        introduction: getApp().globalData.accountINFO.introduction,
      })
    }
  },

  // 头像
  setTouxiang:function(){
    // this.setData({
    //   hidFeet: false
    // })
    wx.showToast({
      icon: 'none',
      title: '小程序端头像修改通道已关闭，请至期行天下官网进行相关操作',
    })
  },
  cancel: function () {
    this.setData({
      hidFeet: true
    })
  },
  shoot:function(){
    var that = this;
    wx.chooseImage({
      count: 1,
      sizeType: ['original', 'compressed'],
      sourceType: ['camera'],
      success(res) {
        // tempFilePath可以作为img标签的src属性显示图片
        const tempFilePaths = res.tempFilePaths;
        that.setData({
          touxiangurl: tempFilePaths
        })
      }
    })
  },
  photo:function(){
    var that = this;
    wx.chooseImage({
      count: 1,
      sizeType: ['original', 'compressed'],
      sourceType: ['album'],
      success(res) {
        // tempFilePath可以作为img标签的src属性显示图片
        const tempFilePaths = res.tempFilePaths;
        that.setData({
          touxiangurl: tempFilePaths
        })
      }
    })
  },
  //用户名
  setYonghuming:function(){
    wx.navigateTo({
      url: '../setyhm/setyhm',
    })
  },
  //个人简介
  setGerenjianjie: function () {
    wx.navigateTo({
      url: '../setgrjj/setgrjj',
    })
  },
  //银行卡
  setBank:function(){
    wx.navigateTo({
      url: '../setbank/setbank',
    })
  },
  //手机换绑
  setPhone:function(){
    wx.showToast({
      icon: 'none',
      title: '暂不支持更换手机',
    })
  },
})